﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DotSpatial.Controls;

using DotSpatial.Topology;

using HAUtil;

using System.Windows.Forms;

using DotSpatial.Data;

using DotSpatial.Symbology;

namespace HAGISV2
{
    public class InteractiveSystem : SubSystem
    {
        public InteractiveSystem(GisManager gis)
            : base(gis)
        {

        }

        #region 事件部分

        //public event ShapeAddHandler AskShapeAdd;
        /// <summary>
        /// 替代AskShapeAdd;
        /// </summary>
        public event NewShapeAddHandler NewAskShapeAdd; 

        public event ConvertedPolyShapeAddHandler AskAddConvertdPolygon;

        public event DefaultHandler CurrentLayerChanged;

        public event EventHandler<MoveHGridCrossPointEventArgs> MoveGridCrossPoint;

        public event EventHandler<EditConceptFrameEventArgs> EditConceptFrame;

        public event EventHandler GridCellDoubleClickAttri;

        public event EventHandler HGMSDoubleClickAttribute;
        /// <summary>
        /// 替代HGMSEditShape
        /// </summary>
        public event EventHandler<HGMSSelectMFEventArgs> NewHGMSEditShape;

        //public event EventHandler<HGMSSelectMFEventArgs> HGMSDeleteShape;

        public event EventHandler<HGMSSelectMFEventArgs> NewHGMSDeleteShape;

        public event EventHandler<Scatter2DPointOperationEventArgs> HScatter2DOperation;

        #endregion


        #region 私有变量


        //HAddPointMF _addPointMF;

        HAddLineMF _addLineMF;

        HSelectMapFunction _selectMF;

        HClipPolyMapFunction _clipPolyMF;

        HMapFunction _currentMF;

        HEditHydrolicGridMF _editHyGridMF;

        HEditConceptFrame _editConceptualFrameMF;

        HGMSSelectMF _gmsSelectMF;

        HScatterPointMF _scatter2DMF;

        LegendMF _legendMF;

        Layer _currentLayer;


        MAPMODE _currentMapMode=MAPMODE.NONE;

        //private IFeatureLayer _activeLayer;

        //public IFeatureLayer ActiveLayer
        //{
        //    get { return _activeLayer; }
        //    set { _activeLayer = value; }
        //}

        #endregion

        

        #region 公共属性

        bool _isUsingGridEditMode;
        /// <summary>
        /// 指示当前选择模式是否处于网格模式
        /// </summary>
        public bool IsUsingGridEditMode
        {
            get { return _isUsingGridEditMode; }
        }
        /// <summary>
        /// 应用标准GIS中当前图层的概念  需后续详细补充
        /// </summary>
        public Layer CurrentLayer
        {
            get
            {
                return _currentLayer;
            }

            set
            {
                /// 当期那图层允许为空
                if (value == null)
                {
                    this._currentLayer = null;
                    return;
                }


                if (_currentLayer != null)
                {
                    if (_currentLayer.IsLoaded)
                    {
                        _currentLayer.ClearSelection();

                    }
                }

                if (value is VectorLayer && (_currentLayer == null || _currentLayer.Id != value.Id))
                {
                    foreach (var item in this.GisManager.LayerSystem.LayerCollection)
                    {
                        this.OnCurrentVLChanged(item);
                    }

                    if ((value as VectorLayer).Visible && (value as VectorLayer).ViewMode == FMAPVIEW.NORMAL)
                    {
                        foreach (var item in (value as VectorLayer).ShapeStyleAndIdStorage)
                        {
                            ((item.Value.Categories[0].Symbolizer as PointSymbolizer).Symbols[0] as SimpleSymbol).Opacity = 1;
                            ((item.Value.Categories[1].Symbolizer as LineSymbolizer).Strokes[0] as SimpleStroke).Opacity = 1;
                        }

                        (value as VectorLayer).PyLayer.IsVisible = true;
                    }
                }

                this._currentLayer = value;

                this.SetMapMode(this._currentMapMode);
            }
        }

        #region 右键菜单

        ContextMenuStrip _scatter2DPointContextMenu;
        /// <summary>
        /// scatter2D点右键菜单
        /// </summary>
        public ContextMenuStrip Scatter2DPointContextMenu
        {
            get { return _scatter2DPointContextMenu; }
            set { _scatter2DPointContextMenu = value; }
        }

        ContextMenuStrip _gridCellSelectContextMenu;
        /// <summary>
        /// 网格单元右键菜单
        /// </summary>
        public ContextMenuStrip GridCellSelectContextMenu
        {
            get { return _gridCellSelectContextMenu; }
            set { _gridCellSelectContextMenu = value; }
        }

        ContextMenuStrip _conceptLayerPointContextMenu;
        /// <summary>
        /// 概念层点右键菜单
        /// </summary>
        public ContextMenuStrip ConceptLayerPointContextMenu
        {
            get { return _conceptLayerPointContextMenu; }
            set { _conceptLayerPointContextMenu = value; }
        }

        ContextMenuStrip _conceptLayerLineContextMenu;
        /// <summary>
        /// 概念层线右键菜单
        /// </summary>
        public ContextMenuStrip ConceptLayerLineContextMenu
        {
            get { return _conceptLayerLineContextMenu; }
            set { _conceptLayerLineContextMenu = value; }
        }

        ContextMenuStrip _conceptLayerVertexContextMenu;
        /// <summary>
        /// 概念层节点右键菜单
        /// </summary>
        public ContextMenuStrip ConceptLayerVertexContextMenu
        {
            get { return _conceptLayerVertexContextMenu; }
            set { _conceptLayerVertexContextMenu = value; }
        }

        ContextMenuStrip _conceptLayerNodeContextMenu;
        /// <summary>
        /// 概念层端点右键菜单
        /// </summary>
        public ContextMenuStrip ConceptLayerNodeContextMenu
        {
            get { return _conceptLayerNodeContextMenu; }
            set { _conceptLayerNodeContextMenu = value; }
        }

        ContextMenuStrip _conceptLayerNoneContextMenu;
        /// <summary>
        /// 概念层无选中时右键菜单
        /// </summary>
        public ContextMenuStrip ConceptLayerNoneContextMenu
        {
            get { return _conceptLayerNoneContextMenu; }
            set { _conceptLayerNoneContextMenu = value; }
        }

        ContextMenuStrip _conceptLayerPolygonContextMenu;
        /// <summary>
        /// 概念层多边形右键菜单
        /// </summary>
        public ContextMenuStrip ConceptLayerPolygonContextMenu
        {
            get { return _conceptLayerPolygonContextMenu; }
            set { _conceptLayerPolygonContextMenu = value; }
        }


        ContextMenuStrip _mainViewContextMenu;

        public ContextMenuStrip MainViewContextMenu
        {
            get { return _mainViewContextMenu; }
            set { _mainViewContextMenu = value; }
        }

        #endregion

        #endregion

        #region 受保护的函数

        /// <summary>
        /// 当前所选概念层更改时
        /// </summary>
        /// <param name="layer"></param>
        void OnCurrentVLChanged(Layer layer)
        {
            if (layer is GroupLayer)
            {
                foreach (var item in (layer as GroupLayer).Childs)
                {
                    this.OnCurrentVLChanged(item);
                }
            }
            else
            {
                if (layer is VectorLayer)
                {
                    if ((layer as VectorLayer).Visible && layer.ViewMode == FMAPVIEW.NORMAL)
                    {
                        foreach (var item in (layer as VectorLayer).ShapeStyleAndIdStorage)
                        {
                            ((item.Value.Categories[0].Symbolizer as PointSymbolizer).Symbols[0] as SimpleSymbol).Opacity = 0.2f;
                            ((item.Value.Categories[1].Symbolizer as LineSymbolizer).Strokes[0] as SimpleStroke).Opacity = 0.2f;
                        }

                        (layer as VectorLayer).PyLayer.IsVisible = false;
                    }
                }
            }
        }

        /// <summary>
        /// 添加图形
        /// </summary>
        /// <param name="type"></param>
        protected void UseMFAddShape(MFSHAPETYPE type)
        {
            if (this._addLineMF == null)
            {
                this._addLineMF = new HAddLineMF(this.GisManager.CurrentMap);

                this._addLineMF.InteractiveSystem = this;


            }
            if (this.GisManager.CurrentMap.MapFunctions.Contains(this._addLineMF) == false)
            {

                this.GisManager.CurrentMap.MapFunctions.Add(this._addLineMF);

            }

            this.GisManager.CurrentMap.Cursor = Cursors.Hand;
            this._addLineMF.MfShapeType = type;


            this._addLineMF.Activate();


        }

        /// <summary>
        /// 选择
        /// </summary>
        protected void UseMFSelect()
        {
            if (this._selectMF == null)
            {
                this._selectMF = new HSelectMapFunction(this.GisManager.CurrentMap);
                this._selectMF.InteractiveSystem = this;


            }

            if (this.GisManager.CurrentMap.MapFunctions.Contains(this._selectMF) == false)
            {
                this.GisManager.CurrentMap.MapFunctions.Add(this._selectMF);
            }

            this.GisManager.CurrentMap.Cursor = Cursors.Cross;



            this._selectMF.Activate();

        }

        /// <summary>
        /// 使用切多边形工具  ====================================现有体系不需要且不兼容此功能 保注释
        /// </summary>
        protected void UseMFClipPoly()
        {
            //if (this._clipPolyMF == null)
            //{
            //    this._clipPolyMF = new HClipPolyMapFunction(this.GisManager.CurrentMap);
            //    this._clipPolyMF.InteractiveSystem = this;

            //}

            //if (this.GisManager.CurrentMap.MapFunctions.Contains(this._clipPolyMF) == false)
            //{
            //    this.GisManager.CurrentMap.MapFunctions.Add(this._clipPolyMF);



            //}

            //this.GisManager.CurrentMap.Cursor = Cursors.Cross;



            //this._clipPolyMF.Activate();
        }

        /// <summary>
        /// 编辑网格
        /// </summary>
        /// <param name="mode"></param>
        protected void UseMFEditHydrolicGrid(MAPMODE mode, ref bool isUsingGridEditMode)
        {
            isUsingGridEditMode = true;
            if (this._editHyGridMF == null)
            {
                this._editHyGridMF = new HEditHydrolicGridMF(this.GisManager.CurrentMap);
                this._editHyGridMF.InteractiveSystem = this;



            }

            if (this.GisManager.CurrentMap.MapFunctions.Contains(this._editHyGridMF) == false)
            {
                this.GisManager.CurrentMap.MapFunctions.Add(this._editHyGridMF);



            }

            this.GisManager.CurrentMap.Cursor = Cursors.Default;

            MFEDITGRIDMODE gmode = MFEDITGRIDMODE.None;

            switch (mode)
            {

                case MAPMODE.GRIDPOINT:
                    gmode = MFEDITGRIDMODE.EditByNode;
                    break;
                case MAPMODE.GRIDCELL:
                    gmode = MFEDITGRIDMODE.SelectByCell;
                    break;
                case MAPMODE.GRIDROW:
                    gmode = MFEDITGRIDMODE.SelectByRowCell;
                    break;
                case MAPMODE.GRIDCOL:

                    gmode = MFEDITGRIDMODE.SelectByColCell;

                    break;
                case MAPMODE.GRIDLAYER:
                    gmode = MFEDITGRIDMODE.SelectByLayer;
                    break;
                case MAPMODE.GRIDADDROW:

                    gmode = MFEDITGRIDMODE.AddRow;

                    break;
                case MAPMODE.GRIDADDCOL:

                    gmode = MFEDITGRIDMODE.AddCol;

                    break;
                default:

                    break;
            }

            this._editHyGridMF.EditGridMode = gmode;

            this._editHyGridMF.Activate();


        }

        /// <summary>
        /// 编辑概念框
        /// </summary>
        protected void UseMFConceptualFrame()
        {
            if (this._editConceptualFrameMF == null)
            {
                this._editConceptualFrameMF = new HEditConceptFrame(this.GisManager.CurrentMap);
                this._editConceptualFrameMF.InteractiveSystem = this;

            }

            if (this.GisManager.CurrentMap.MapFunctions.Contains(this._editConceptualFrameMF) == false)
            {
                this.GisManager.CurrentMap.MapFunctions.Add(this._editConceptualFrameMF);



            }

            //this.GisManager.CurrentMap.Cursor = Cursors.Cross;



            this._editConceptualFrameMF.Activate();
        }

        /// <summary>
        /// 概念层实体操作
        /// </summary>
        /// <param name="mode"></param>
        protected void UseMFGMSSelect(MAPMODE mode)
        {
            if (this._gmsSelectMF == null)
            {
                this._gmsSelectMF = new HGMSSelectMF(this.GisManager.CurrentMap);
                this._gmsSelectMF.InteractiveSystem = this;

            }

            if (this.GisManager.CurrentMap.MapFunctions.Contains(this._gmsSelectMF) == false)
            {
                this.GisManager.CurrentMap.MapFunctions.Add(this._gmsSelectMF);

            }


            //this.GisManager.CurrentMap.Cursor = Cursors.Cross;
            HSelectMode selectMode = HSelectMode.None;
            switch (mode)
            {
                case MAPMODE.ALLSELECT:
                    selectMode = HSelectMode.All;
                    break;
                case MAPMODE.NODESELECT:
                    selectMode = HSelectMode.Node;
                    break;
                case MAPMODE.VERTEXSELECT:
                    selectMode = HSelectMode.Vertex;
                    break;
                case MAPMODE.LINESELECT:
                    selectMode = HSelectMode.Line;
                    break;
                case MAPMODE.LINEARRAYSELECT:
                    selectMode = HSelectMode.Group;
                    break;
                case MAPMODE.PLANSELECT:
                    selectMode = HSelectMode.Polygon;
                    break;
                case MAPMODE.ADDVERTEX:
                    selectMode = HSelectMode.InsertVertex;
                    break;

                default:
                    break;
            }



            this._gmsSelectMF.SetSelectMode(selectMode);

            this._gmsSelectMF.Activate();
        }

        /// <summary>
        /// Scatter2D层操作
        /// </summary>
        /// <param name="mode"></param>
        protected void UseMFScatter2D(MAPMODE mode)
        {
            if (_scatter2DMF == null)
            {
                this._scatter2DMF = new HScatterPointMF(this.GisManager.CurrentMap);
                this._scatter2DMF.InteractiveSystem = this;
            }
            if (!this.GisManager.CurrentMap.MapFunctions.Contains(this._scatter2DMF))
                this.GisManager.CurrentMap.MapFunctions.Add(_scatter2DMF);

            switch (mode)
            {
                case MAPMODE.SCATTER2DSELECT:
                    this._scatter2DMF.OperationMode = MFSCATTER2DMODE.Select;
                    break;
                case MAPMODE.SCATTER2DADD:
                    this.GisManager.CurrentMap.Cursor = Cursors.Hand;
                    this._scatter2DMF.OperationMode = MFSCATTER2DMODE.Add;
                    break;
                default:
                    break;
            }


            this._scatter2DMF.Activate();
        }

        /// <summary>
        /// 移动图例操作
        /// </summary>
        protected void UseMoveLegendMF(string layerId)
        {
            if (_legendMF == null)
            {
                this._legendMF = new LegendMF(this.GisManager.CurrentMap);
                this._legendMF.InteractiveSystem = this;
            }
            if (!this.GisManager.CurrentMap.MapFunctions.Contains(this._legendMF))
                this.GisManager.CurrentMap.MapFunctions.Add(_legendMF);

            this._legendMF.layer = this.GisManager.LayerSystem.LayerCollection.GetLayer(layerId) as IsolineLayer;

            this._legendMF.Activate();
        }

        #endregion



        #region 公共函数部分
        /// <summary>
        /// 设置Map当前操作模式
        /// </summary>
        /// <param name="mode"></param>
        /// <param name="layerId">给所需要使用特定的图层传递ID</param>
        public void SetMapMode(MAPMODE mode,string layerId="")
        {

           

            //首先保存当前模式

            this._currentMapMode = mode;



            //进行对应的处理

            this.GisManager.CurrentMap.FunctionMode = FunctionMode.None;
            _isUsingGridEditMode = false;

            switch (mode)
            {
                case MAPMODE.NONE:

                    this.GisManager.CurrentMap.FunctionMode = FunctionMode.Pan;

                    break;


                case MAPMODE.SELECT:




                    //this.GisManager.CurrentMap.FunctionMode = FunctionMode.Select;

                    this.UseMFSelect();



                    break;
                case MAPMODE.ZOOMIN:

                    this.GisManager.CurrentMap.FunctionMode = FunctionMode.ZoomIn;

                    break;
                case MAPMODE.ZOOMOUT:

                    this.GisManager.CurrentMap.FunctionMode = FunctionMode.ZoomOut;

                    break;

                case MAPMODE.PAN:

                    this.GisManager.CurrentMap.FunctionMode = FunctionMode.Pan;

                    break;


                case MAPMODE.ADDPOINT:

                    ///当用户正在操作矢量图层时
                    if (this._currentLayer is VectorLayer)
                    {

                        this.UseMFAddShape(MFSHAPETYPE.POINT);

                    }

                    else
                    {

                    }







                    break;


                case MAPMODE.ADDLINE:

                    this.UseMFAddShape(MFSHAPETYPE.LINE);

                    break;

                //case MAPMODE.ADDPOLYLINE:

                //    this.UseMFAddShape(MFSHAPETYPE.POLYLINE);

                //    break;


                case MAPMODE.ADDPOLYGON:

                    this.UseMFAddShape(MFSHAPETYPE.POLYGON);

                    break;


                case MAPMODE.MEASURE:

                    this.GisManager.CurrentMap.FunctionMode = FunctionMode.Measure;

                    break;


                case MAPMODE.TRANSLATE:
                    break;



                //图形编辑部分


                case MAPMODE.CLIPPOLY:

                    this.UseMFClipPoly();

                    break;




                //进入三维化网格编辑部分

                case MAPMODE.GRIDPOINT:

                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);

                    break;

                case MAPMODE.GRIDCELL:

                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);

                    break;


                case MAPMODE.GRIDROW:
                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);
                    break;
                case MAPMODE.GRIDCOL:

                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);

                    break;
                case MAPMODE.GRIDLAYER:
                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);
                    break;
                case MAPMODE.GRIDADDROW:

                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);

                    break;
                case MAPMODE.GRIDADDCOL:

                    this.UseMFEditHydrolicGrid(mode, ref _isUsingGridEditMode);

                    break;



                case MAPMODE.GRIDFRAME:

                    this.UseMFConceptualFrame();

                    break;

                case MAPMODE.ALLSELECT:
                    this.UseMFGMSSelect(mode);
                    break;

                case MAPMODE.NODESELECT:

                    this.UseMFGMSSelect(mode);

                    break;

                case MAPMODE.VERTEXSELECT:
                    this.UseMFGMSSelect(mode);
                    break;

                case MAPMODE.LINESELECT:
                    this.UseMFGMSSelect(mode);
                    break;

                case MAPMODE.LINEARRAYSELECT:
                    this.UseMFGMSSelect(mode);
                    break;

                case MAPMODE.PLANSELECT:
                    this.UseMFGMSSelect(mode);
                    break;

                case MAPMODE.ADDVERTEX:
                    this.UseMFGMSSelect(mode);
                    break; 


                //Scatter2D操作部分
                case MAPMODE.SCATTER2DSELECT:
                    this.UseMFScatter2D(mode);
                    break;

                case MAPMODE.SCATTER2DADD:
                    this.UseMFScatter2D(mode);
                    break;

                    
                case MAPMODE.MOVELEGEND://移动图例

                    this.UseMoveLegendMF(layerId);
                    
                    break;

                default:
                    break;
            }
        }


        public ContextMenuStrip GetConceptLayerRightClickMenu(CONCEPTLAYERRIGHTMENU mode)
        {
            switch (mode)
            {
                case CONCEPTLAYERRIGHTMENU.NONE:
                    return _conceptLayerNoneContextMenu;

                case CONCEPTLAYERRIGHTMENU.POINT:
                    return _conceptLayerPointContextMenu;

                case CONCEPTLAYERRIGHTMENU.LINE:
                    return _conceptLayerLineContextMenu;

                case CONCEPTLAYERRIGHTMENU.VERTEX:
                    return _conceptLayerVertexContextMenu;

                case CONCEPTLAYERRIGHTMENU.NODE:
                    return _conceptLayerNodeContextMenu;

                case CONCEPTLAYERRIGHTMENU.POLYGON:
                    return _conceptLayerPolygonContextMenu;

                default:
                    return _conceptLayerNoneContextMenu;
            }
        }


        #region 事件触发接口

        public void AskAddScatter2DPoint(string layerId, Coordinate coord,List<double> values)
        {
            if(this.HScatter2DOperation!=null)
                this.HScatter2DOperation(this,new Scatter2DPointOperationEventArgs(layerId,coord,values));
        }

        public void AskDeleteScatter2DPoints(string layerId,List<string> shapeIds)
        {
            if (this.HScatter2DOperation != null)
                this.HScatter2DOperation(this, new Scatter2DPointOperationEventArgs(layerId, shapeIds));
        }

        public void AskEditScatter2DPoint(string layerId, string shapeId, List<double> values, Coordinate coord)
        {
            if (this.HScatter2DOperation != null)
                this.HScatter2DOperation(this, new Scatter2DPointOperationEventArgs(layerId, shapeId, values, coord));
        }


        public void NewAskAddShape(string groupName, Coordinate[] coords, List<string> vertexIds, MFSHAPETYPE type, Dictionary<List<int>, Coordinate> lineBreak = null)
        {
            if (NewAskShapeAdd != null)
            {
                this.NewAskShapeAdd(groupName, coords, vertexIds, type, lineBreak);

            }
        }

        public void AskAddConvertedPolyShape(string groupName,string polyLineKey,Coordinate[] coords,List<Coordinate[]> holes)
        {
            if (AskAddConvertdPolygon != null)
            {
                this.AskAddConvertdPolygon(groupName, polyLineKey, coords, holes);
            }
        }

        public void HGMSAskDeleteShape(HGMSSelectMFEventArgs args)
        {
            //if (HGMSDeleteShape != null)
            //{
            //    this.HGMSDeleteShape(this, args);
            //}

            if (NewHGMSDeleteShape != null)
                NewHGMSDeleteShape(this, args);
        }

        public void HGMSAskEditShape(HGMSSelectMFEventArgs args)
        {
            //if (HGMSEditShape != null)
            //{
            //    this.HGMSEditShape(this, args);
            //}

            if (NewHGMSEditShape != null)
                NewHGMSEditShape(this, args);
        }

        public void HGMSAskUnionOrSplitShape(HGMSSelectMFEventArgs args)
        {
            //if (args.IsUnion)//合并
            //{
            //    if (args.FeatureIds.Count < 2||args.Features.Count<1)
            //        return;
            //    if (args.Features[0].BasicGeometry is LinearRing)
            //    {
            //        this.AskAddShape(args.GroupName, args.Features[0].BasicGeometry.Coordinates.ToArray(), null, MFSHAPETYPE.POLYLINE);
            //    }
            //    else
            //    {
            //        this.AskAddShape(args.GroupName, args.Features[0].BasicGeometry.Coordinates.ToArray(), null, MFSHAPETYPE.LINE);
            //    }
            //    for (int i = 0; i < args.FeatureIds.Count; i++)
            //    {
            //        HGMSSelectMFEventArgs argsDelete = new HGMSSelectMFEventArgs(args.LayerId, args.FeatureIds[i], null,false);
            //        this.HGMSAskDeleteShape(argsDelete);
            //    }
                
            //}
            //else//分割
            //{
            //    if (args.FeatureIds.Count < 1 || args.Features.Count < 2)
            //        return;

            //    HGMSSelectMFEventArgs argsEdit = new HGMSSelectMFEventArgs(args.LayerId, args.FeatureIds[0], args.Features[0],false);
            //    this.HGMSAskDeleteShape(argsEdit);

                

            //    for (int i = 0; i < args.Features.Count; i++)
            //    {
            //        this.AskAddShape(args.GroupName, args.Features[i].BasicGeometry.Coordinates.ToArray(),null ,MFSHAPETYPE.LINE);
            //    }
               

            //}

        }

        //网格单元双击属性表事件
        public void GridCellDoubleClickAttribute()
        {
            if (GridCellDoubleClickAttri != null)
                GridCellDoubleClickAttri(null, null);
        }

        //概念层双击属性表事件
        public void HGMSDoubleClickAttributeTable()
        {
            if (HGMSDoubleClickAttribute != null)
                HGMSDoubleClickAttribute(null, null);
        }


        public void AskEditConceptFrame(EditConceptFrameEventArgs args)
        {
            if (EditConceptFrame != null)
            {
                EditConceptFrame(this, args);
            }
        }


        public void AskMoveCrossPoint(MoveHGridCrossPointEventArgs args)
        {
            if (MoveGridCrossPoint != null)
            {
                this.MoveGridCrossPoint(this, args);

            }
        }


        public void AskMoveShape()
        {

        }

        #endregion

        #endregion
    }
}
